Data for Interactive Figure


In [1]:
DT <- read.table("../Data/All_data.txt")

In [2]:
names(DT)


  1. 'Region'
  2. 'Disease'
  3. 'burden_daly'
  4. 'burden_yll'
  5. 'burden_yld'
  6. 'burden_death'
  7. 'Prop_loc_burden_daly'
  8. 'Prop_loc_burden_yll'
  9. 'Prop_loc_burden_yld'
  10. 'Prop_loc_burden_death'
  11. 'Prop_glob_burden_daly'
  12. 'Prop_glob_burden_yll'
  13. 'Prop_glob_burden_yld'
  14. 'Prop_glob_burden_death'
  15. 'Prop_NHI_burden_daly'
  16. 'Prop_NHI_burden_yll'
  17. 'Prop_NHI_burden_yld'
  18. 'Prop_NHI_burden_death'
  19. 'Nb_RCTs_low'
  20. 'Nb_RCTs_med'
  21. 'Nb_RCTs_up'
  22. 'Nb_Patients_low'
  23. 'Nb_Patients_med'
  24. 'Nb_Patients_up'
  25. 'Prop_loc_RCTs_low'
  26. 'Prop_loc_RCTs_med'
  27. 'Prop_loc_RCTs_up'
  28. 'Prop_loc_Patients_low'
  29. 'Prop_loc_Patients_med'
  30. 'Prop_loc_Patients_up'
  31. 'Prop_glob_RCTs_low'
  32. 'Prop_glob_RCTs_med'
  33. 'Prop_glob_RCTs_up'
  34. 'Prop_glob_Patients_low'
  35. 'Prop_glob_Patients_med'
  36. 'Prop_glob_Patients_up'
  37. 'Prop_NHI_RCTs_low'
  38. 'Prop_NHI_RCTs_med'
  39. 'Prop_NHI_RCTs_up'
  40. 'Prop_NHI_Patients_low'
  41. 'Prop_NHI_Patients_med'
  42. 'Prop_NHI_Patients_up'

In [3]:
head(DT)


RegionDiseaseburden_dalyburden_yllburden_yldburden_deathProp_loc_burden_dalyProp_loc_burden_yllProp_loc_burden_yldProp_loc_burden_deathProp_glob_RCTs_upProp_glob_Patients_lowProp_glob_Patients_medProp_glob_Patients_upProp_NHI_RCTs_lowProp_NHI_RCTs_medProp_NHI_RCTs_upProp_NHI_Patients_lowProp_NHI_Patients_medProp_NHI_Patients_up
1All All 2220063510.800761548796838.65609671266365.04493546250530.2665929100 100 100 100 NA NA NA NA NA NA NA NA NA NA
2All Cardiovascular and circulatory diseases287404109.09231 267807387.790028 19596607.312309 14726543.7199449 12.9457606818034 17.2913180803241 2.91934891017476 31.8408105486781 NA NA NA NA NA NA NA NA NA NA
3All Chronic respiratory diseases112485355.22285 67399684.65133 45085687.018707 3572762.590618 5.06676294059161 4.35174472010244 6.71651215768706 7.72480352122283 NA NA NA NA NA NA NA NA NA NA
4All Cirrhosis of the liver30462721.1164 29883176.0549 579531.730192 990159.446125 1.37215538961821 1.9294445410174 0.0863340933450771 2.14086074347173 NA NA NA NA NA NA NA NA NA NA
5All Congenital anomalies43254504.439 40150785.446 3103715.2332 553886.39191 1.94834536167834 2.59238555011768 0.462367160760727 1.19757846821937 NA NA NA NA NA NA NA NA NA NA
6All Diabetes, urinary diseases and male infertility75821480.094146 48042869.768465 27778586.1421424 2082326.848938 3.41528428016898 3.10194781971226 4.13823596543272 4.50227670241887 NA NA NA NA NA NA NA NA NA NA

In [4]:
levels(DT$Disease)


  1. 'All'
  2. 'Cardiovascular and circulatory diseases'
  3. 'Chronic respiratory diseases'
  4. 'Cirrhosis of the liver'
  5. 'Congenital anomalies'
  6. 'Diabetes, urinary diseases and male infertility'
  7. 'Diarrhea, lower respiratory infections, meningitis, and other common infectious diseases'
  8. 'Digestive diseases (except cirrhosis)'
  9. 'Gynecological diseases'
  10. 'Hemoglobinopathies and hemolytic anemias'
  11. 'Hepatitis'
  12. 'HIV/AIDS'
  13. 'Leprosy'
  14. 'Malaria'
  15. 'Maternal disorders'
  16. 'Mental and behavioral disorders'
  17. 'Musculoskeletal disorders'
  18. 'Neglected tropical diseases excluding malaria'
  19. 'Neonatal disorders'
  20. 'Neoplasms'
  21. 'Neurological disorders'
  22. 'Nutritional deficiencies'
  23. 'Oral disorders'
  24. 'Sense organ diseases'
  25. 'Sexually transmitted diseases excluding HIV'
  26. 'Skin and subcutaneous diseases'
  27. 'Sudden infant death syndrome'
  28. 'Tuberculosis'

In [5]:
DT$Dis_lab <- DT$Disease

levels(DT$Dis_lab) <- c("",
               "Cardiovasc.\n& circulatory",
               "Chronic\nrespiratory",
               "Cirrhosis",
               "Congenital\nanomalies",
               "Diabetes, urin.\nmale infertility",
               "Common\ninfect. dis.",
               "Digestive\ndis.",
               "Gynecol.\ndis.",
               "Hemoglob. &\nhemolytic\nanemia",
               "Hepatitis",
               "HIV",
               "Leprosy",
               "Malaria",
               "Maternal\ndisorders",
               "Mental and\nbehavioral",
               "Musculosk.\ndisorders",
               "Neglected trop.\ndiseases.",
               "Neonatal\ndisorders",
               "Neoplasms",
               "Neurological\ndisorders",
               "Nutritional\ndeficiencies",
               "Oral\ndisorders",
               "Sense organ\ndiseases",
               "STD",
               "Skin and\nsubcutan.",
               "Sudden infant\ndeath synd.",
               "Tuberculosis")

DT$Dis_tooltip <- DT$Disease

levels(DT$Dis_tooltip) <- c("All diseases",
               "Cardiovascular and circulatory diseases",
               "Chronic respiratory diseases",
               "Cirrhosis of the liver",
               "Congenital anomalies",
               "Diabetes, urinary diseases and male infertility",
               "Common infectious diseases",
               "Digestive diseases",
               "Gynecological diseases",
               "Hemoglobinopathies and hemolytic anemias",
               "Hepatitis",
               "HIV",
               "Leprosy",
               "Malaria",
               "Maternal disorders",
               "Mental and behavioral disorders",
               "Musculoskeletal disorders",
               "Neglected tropical diseases",
               "Neonatal disorders",
               "Neoplasms",
               "Neurological disorders",
               "Nutritional deficiencies",
               "Oral disorders",
               "Sense organ diseases",
               "Sexually transmitted diseases excluding HIV",
               "Skin and subcutaneous diseases",
               "Sudden infant death syndrome",
               "Tuberculosis")


DT$regs_lab <- DT$Region

levels(DT$regs_lab) <-  c("World",
                          "Eastern Europe and Central Asia",
                          "High-income countries",
                          "Latin America and Caribbean",
                          "Non-high-income countries",
                          "North Africa and Middle East",
                          "South Asia",
                          "Southeast Asia, East Asia and Oceania",
                          "Sub-Saharian Africa")

In [9]:
Mgbd <- read.table("../Data/27_gbd_groups.txt")
Mgbd$tooltip <- Mgbd$x
levels(Mgbd$tooltip) <- levels(DT$Dis_tooltip)[-1]
Mgbd$tooltip


  1. Tuberculosis
  2. HIV
  3. Common infectious diseases
  4. Malaria
  5. Neglected tropical diseases
  6. Maternal disorders
  7. Neonatal disorders
  8. Nutritional deficiencies
  9. Sexually transmitted diseases excluding HIV
  10. Hepatitis
  11. Leprosy
  12. Neoplasms
  13. Cardiovascular and circulatory diseases
  14. Chronic respiratory diseases
  15. Cirrhosis of the liver
  16. Digestive diseases
  17. Neurological disorders
  18. Mental and behavioral disorders
  19. Diabetes, urinary diseases and male infertility
  20. Gynecological diseases
  21. Hemoglobinopathies and hemolytic anemias
  22. Musculoskeletal disorders
  23. Congenital anomalies
  24. Skin and subcutaneous diseases
  25. Sense organ diseases
  26. Oral disorders
  27. Sudden infant death syndrome

Adding observed data for non simulated diseases


In [6]:
unique(DT$Disease[is.na(DT$Nb_RCTs_med)])


  1. Hemoglobinopathies and hemolytic anemias
  2. Leprosy
  3. Sudden infant death syndrome

In [7]:
library(data.table)
data <- read.table("/media/igna/Elements/HotelDieu/Cochrane/MappingRCTs_vs_Burden/database_RCTs_regions_27diseases.txt")


Warning message:
“package ‘data.table’ was built under R version 3.3.2”

In [8]:
Lgbd <- lapply(as.character(data$GBD27),function(x){as.numeric(unlist(strsplit(x,"&")))})

In [9]:
regs <- sort(unique(unlist(strsplit(as.character(data$Regions),"&"))))
LR <- lapply(regs,function(x){1:nrow(data)%in%grep(x,data$Regions)})
LR <- do.call('cbind',LR)
LR <- data.table(LR)
LR$TrialID <- data$TrialID

#Nb of patients per region per trial
#Supressing sample size of trials with sample size below 10 and above 200k
data$Sample[data$Sample<10 | data$Sample>200000] <- NA
#Nb countries per region per trial to distribute sample size equally across countries
nb_ctrs <- lapply(strsplit(as.character(data$Nb_ctr_per_reg),'&'),as.numeric)
RGs <-strsplit(as.character(data$Regions),'&')
pats <- data.frame(TrialID = rep(data$TrialID,sapply(nb_ctrs,length)),
                   Nb_ctrs = unlist(nb_ctrs),
                   Region = unlist(RGs),
                   Tot_sample = rep(data$Sample,sapply(nb_ctrs,length)))

pats$tot_ctrs <- rep(sapply(nb_ctrs,sum),sapply(nb_ctrs,length))
pats$sample_per_reg <- pats$Tot_sample*pats$Nb_ctrs/pats$tot_ctrs
pats <- data.table(pats)
setkey(pats,TrialID)

In [10]:
dis <- which(Mgbd$x%in%unique(DT$Disease[is.na(DT$Nb_RCTs_med)]))
dis


  1. 11
  2. 21
  3. 27

In [11]:
A <- list()
for(i in 1:length(dis)){
    d <- dis[i]
    repl <- data.table(
        TrialID = data$TrialID,
        recl_dis = as.numeric(unlist(lapply(Lgbd,function(x){d%in%x}))),
        recl_gbd = as.numeric(unlist(lapply(Lgbd,function(x){length(x)>0})))
        )
    setkey(repl,TrialID)
    replpats <- merge(pats,repl)
    setkey(replpats,Region)

    #Output data
    df <- data.table(Region=c(sort(regs),"All","Non-HI"),Dis=rep(c("dis","all"),each=9),RCTs=as.integer(0),Patients=as.numeric(0))

    #Par région
    #Nb trials par region concernant la maladie and relevant to GBD
    df[Dis=="dis" & Region%in%regs,RCTs:=table(replpats[recl_dis==1,Region])]
    df[Dis=="all" & Region%in%regs,RCTs:=table(replpats[recl_gbd>=1,Region])]
    #Nb patients par région concernant la maladie and relevant to GBD
    df[Dis=="dis" & Region%in%regs,Patients:=replpats[recl_dis==1,][regs,sum(sample_per_reg,na.rm=TRUE),by=.EACHI]$V1]
    df[Dis=="all" & Region%in%regs,Patients:=replpats[recl_gbd>=1,][regs,sum(sample_per_reg,na.rm=TRUE),by=.EACHI]$V1]

    #WorldWide
    #Nb trials worldwide concernant la maladie and relevant to GBD
    df[Dis=="dis" & Region=="All",RCTs:=sum(repl$recl_dis)]
    df[Dis=="all" & Region=="All",RCTs:=sum(repl$recl_gbd>=1)]
    #Nb patients worldwide concernant la maladie and relevant to GBD
    df[Dis=="dis" & Region=="All",Patients:=sum(replpats[recl_dis==1,sample_per_reg],na.rm=TRUE)]
    df[Dis=="all" & Region=="All",Patients:=sum(replpats[recl_gbd>=1,sample_per_reg],na.rm=TRUE)]

    #Non-HI countries
    #Nb trials worldwide concernant la maladie and relevant to GBD
    df[Dis=="dis" & Region=="Non-HI",RCTs:=replpats[Region!="High-income",][recl_dis==1,][!duplicated(TrialID),.N]]
    df[Dis=="all" & Region=="Non-HI",RCTs:=replpats[Region!="High-income",][recl_gbd>=1,][!duplicated(TrialID),.N]]
    #Nb patients worldwide concernant la maladie and relevant to GBD
    df[Dis=="dis" & Region=="Non-HI",Patients:=sum(replpats[Region!="High-income",][recl_dis==1,sample_per_reg],na.rm=TRUE)]
    df[Dis=="all" & Region=="Non-HI",Patients:=sum(replpats[Region!="High-income",][recl_gbd>=1,sample_per_reg],na.rm=TRUE)]

    A[[i]] <- df
    
    }

Within regions


In [12]:
data_f <- data.frame()

for(i in 1:length(dis)){
    
    d <- dis[i]
    DF <- A[[i]]

    data <- DF[Dis=="dis",][,lapply(.SD,function(x){quantile(x,probs=c(0.025,0.5,0.975))}),
                        by=c("Region"),
                        .SDcols=c("RCTs","Patients")]
    dataprop <- DF[,lapply(.SD[Dis=="dis",]/.SD[Dis=="all",],function(x){100*quantile(x,probs=c(0.025,0.5,0.975))}),
                        by=c("Region"),
                        .SDcols=c("RCTs","Patients")]

    df <- data.frame(cbind(cbind(unique(data$Region),as.character(Mgbd$x[d])),
          matrix(data$RCTs,ncol=3,byrow=TRUE),
          matrix(data$Patients,ncol=3,byrow=TRUE),
          matrix(dataprop$RCTs,ncol=3,byrow=TRUE),
          matrix(dataprop$Patients,ncol=3,byrow=TRUE)))

    names(df) <- c("Region","Disease",
                   paste(paste("Nb","RCTs",sep="_"),c("low","med","up"),sep="_"),
                   paste(paste("Nb","Patients",sep="_"),c("low","med","up"),sep="_"),
                   paste(paste("Prop","RCTs",sep="_"),c("low","med","up"),sep="_"),
                   paste(paste("Prop","Patients",sep="_"),c("low","med","up"),sep="_"))
    
    data_f <- rbind(data_f,df)
}

In [13]:
data_f <- data_f[order(as.character(data_f$Region),as.character(data_f$Disease)),]
DT <- DT[order(as.character(DT$Region),as.character(DT$Disease)),]
table(paste(data_f$Region,data_f$Disease)==paste(DT$Region,DT$Disease)[DT$Disease%in%as.character(Mgbd$x[dis])])


TRUE 
  27 

In [14]:
names(data_f)
names(DT)


  1. 'Region'
  2. 'Disease'
  3. 'Nb_RCTs_low'
  4. 'Nb_RCTs_med'
  5. 'Nb_RCTs_up'
  6. 'Nb_Patients_low'
  7. 'Nb_Patients_med'
  8. 'Nb_Patients_up'
  9. 'Prop_RCTs_low'
  10. 'Prop_RCTs_med'
  11. 'Prop_RCTs_up'
  12. 'Prop_Patients_low'
  13. 'Prop_Patients_med'
  14. 'Prop_Patients_up'
  1. 'Region'
  2. 'Disease'
  3. 'burden_daly'
  4. 'burden_yll'
  5. 'burden_yld'
  6. 'burden_death'
  7. 'Prop_loc_burden_daly'
  8. 'Prop_loc_burden_yll'
  9. 'Prop_loc_burden_yld'
  10. 'Prop_loc_burden_death'
  11. 'Prop_glob_burden_daly'
  12. 'Prop_glob_burden_yll'
  13. 'Prop_glob_burden_yld'
  14. 'Prop_glob_burden_death'
  15. 'Prop_NHI_burden_daly'
  16. 'Prop_NHI_burden_yll'
  17. 'Prop_NHI_burden_yld'
  18. 'Prop_NHI_burden_death'
  19. 'Nb_RCTs_low'
  20. 'Nb_RCTs_med'
  21. 'Nb_RCTs_up'
  22. 'Nb_Patients_low'
  23. 'Nb_Patients_med'
  24. 'Nb_Patients_up'
  25. 'Prop_loc_RCTs_low'
  26. 'Prop_loc_RCTs_med'
  27. 'Prop_loc_RCTs_up'
  28. 'Prop_loc_Patients_low'
  29. 'Prop_loc_Patients_med'
  30. 'Prop_loc_Patients_up'
  31. 'Prop_glob_RCTs_low'
  32. 'Prop_glob_RCTs_med'
  33. 'Prop_glob_RCTs_up'
  34. 'Prop_glob_Patients_low'
  35. 'Prop_glob_Patients_med'
  36. 'Prop_glob_Patients_up'
  37. 'Prop_NHI_RCTs_low'
  38. 'Prop_NHI_RCTs_med'
  39. 'Prop_NHI_RCTs_up'
  40. 'Prop_NHI_Patients_low'
  41. 'Prop_NHI_Patients_med'
  42. 'Prop_NHI_Patients_up'
  43. 'Dis_lab'
  44. 'Dis_tooltip'
  45. 'regs_lab'

In [15]:
DT$Nb_RCTs_med[DT$Disease%in%as.character(Mgbd$x[dis])] <- as.numeric(as.character(data_f$Nb_RCTs_med))
DT$Nb_Patients_med[DT$Disease%in%as.character(Mgbd$x[dis])] <- as.numeric(as.character(data_f$Nb_Patients_med))
DT$Prop_loc_RCTs_med[DT$Disease%in%as.character(Mgbd$x[dis])] <- as.numeric(as.character(data_f$Prop_RCTs_med))
DT$Prop_loc_Patients_med[DT$Disease%in%as.character(Mgbd$x[dis])] <- as.numeric(as.character(data_f$Prop_Patients_med))

Within diseases


In [16]:
regs <- sort(unique(DF$Region))
regs <- regs[regs!="All"]
regs


  1. 'Central Europe, Eastern Europe, and Central Asia'
  2. 'High-income'
  3. 'Latin America and Caribbean'
  4. 'Non-HI'
  5. 'North Africa and Middle East'
  6. 'South Asia'
  7. 'Southeast Asia, East Asia and Oceania'
  8. 'Sub-Saharian Africa'

In [17]:
data_f <- data.frame()

for(i in 1:length(dis)){
    d <- dis[i]
    DF <- A[[i]]

    DFr <- DF[DF$Region%in%regs & DF$Dis == "dis",]
    DFr$RCTs_all <- rep(DF$RCTs[DF$Dis=="dis" & DF$Region=="All"],each=length(regs))
    DFr$RCTs_NHI <- rep(DF$RCTs[DF$Dis=="dis" & DF$Region=="Non-HI"],each=length(regs))
    DFr$Patients_all <- rep(DF$Patients[DF$Dis=="dis" & DF$Region=="All"],each=length(regs))
    DFr$Patients_NHI <- rep(DF$Patients[DF$Dis=="dis" & DF$Region=="Non-HI"],each=length(regs))

    df <- data.frame(cbind(regs,as.character(Mgbd$x[d]),
        do.call('rbind',by(DFr[DFr$RCTs_all!=0,],
                           DFr$Region[DFr$RCTs_all!=0],
                           function(x){100*quantile(x$RCTs/x$RCTs_all,probs=c(0.025,0.5,0.975))})),
        do.call('rbind',by(DFr[DFr$Patients_all!=0,],
                           DFr$Region[DFr$Patients_all!=0],
                           function(x){100*quantile(x$Patients/x$Patients_all,probs=c(0.025,0.5,0.975))}))))

    if(sum(DFr$RCTs_NHI)!=0){
        df <- cbind(df,cbind(                   
            do.call('rbind',by(DFr[DFr$RCTs_NHI!=0,],
                               DFr$Region[DFr$RCTs_NHI!=0],
                               function(x){100*quantile(x$RCTs/x$RCTs_NHI,probs=c(0.025,0.5,0.975))})),
            do.call('rbind',by(DFr[DFr$Patients_NHI!=0,],
                               DFr$Region[DFr$Patients_NHI!=0],
                               function(x){100*quantile(x$Patients/x$Patients_NHI,probs=c(0.025,0.5,0.975))}))))
    }
    if(sum(DFr$RCTs_NHI)==0){
        df <- cbind(df,matrix(0,nrow=length(regs),ncol=3),matrix(0,nrow=length(regs),ncol=3))
    }


    names(df) <- c("Region","Disease",
               paste(paste("Prop_all","RCTs",sep="_"),c("low","med","up"),sep="_"),
               paste(paste("Prop_all","Patients",sep="_"),c("low","med","up"),sep="_"),
               paste(paste("Prop_NHI","RCTs",sep="_"),c("low","med","up"),sep="_"),
               paste(paste("Prop_NHI","Patients",sep="_"),c("low","med","up"),sep="_"))

    data_f <- rbind(data_f,df)
}

In [18]:
data_f <- data_f[order(as.character(data_f$Region),as.character(data_f$Disease)),]
table(paste(data_f$Region,data_f$Disease)==paste(DT$Region,DT$Disease)[DT$Disease%in%as.character(Mgbd$x[dis]) & DT$Region!="All"])


TRUE 
  24 

In [19]:
names(data_f)
names(DT)


  1. 'Region'
  2. 'Disease'
  3. 'Prop_all_RCTs_low'
  4. 'Prop_all_RCTs_med'
  5. 'Prop_all_RCTs_up'
  6. 'Prop_all_Patients_low'
  7. 'Prop_all_Patients_med'
  8. 'Prop_all_Patients_up'
  9. 'Prop_NHI_RCTs_low'
  10. 'Prop_NHI_RCTs_med'
  11. 'Prop_NHI_RCTs_up'
  12. 'Prop_NHI_Patients_low'
  13. 'Prop_NHI_Patients_med'
  14. 'Prop_NHI_Patients_up'
  1. 'Region'
  2. 'Disease'
  3. 'burden_daly'
  4. 'burden_yll'
  5. 'burden_yld'
  6. 'burden_death'
  7. 'Prop_loc_burden_daly'
  8. 'Prop_loc_burden_yll'
  9. 'Prop_loc_burden_yld'
  10. 'Prop_loc_burden_death'
  11. 'Prop_glob_burden_daly'
  12. 'Prop_glob_burden_yll'
  13. 'Prop_glob_burden_yld'
  14. 'Prop_glob_burden_death'
  15. 'Prop_NHI_burden_daly'
  16. 'Prop_NHI_burden_yll'
  17. 'Prop_NHI_burden_yld'
  18. 'Prop_NHI_burden_death'
  19. 'Nb_RCTs_low'
  20. 'Nb_RCTs_med'
  21. 'Nb_RCTs_up'
  22. 'Nb_Patients_low'
  23. 'Nb_Patients_med'
  24. 'Nb_Patients_up'
  25. 'Prop_loc_RCTs_low'
  26. 'Prop_loc_RCTs_med'
  27. 'Prop_loc_RCTs_up'
  28. 'Prop_loc_Patients_low'
  29. 'Prop_loc_Patients_med'
  30. 'Prop_loc_Patients_up'
  31. 'Prop_glob_RCTs_low'
  32. 'Prop_glob_RCTs_med'
  33. 'Prop_glob_RCTs_up'
  34. 'Prop_glob_Patients_low'
  35. 'Prop_glob_Patients_med'
  36. 'Prop_glob_Patients_up'
  37. 'Prop_NHI_RCTs_low'
  38. 'Prop_NHI_RCTs_med'
  39. 'Prop_NHI_RCTs_up'
  40. 'Prop_NHI_Patients_low'
  41. 'Prop_NHI_Patients_med'
  42. 'Prop_NHI_Patients_up'
  43. 'Dis_lab'
  44. 'Dis_tooltip'
  45. 'regs_lab'

In [20]:
DT$Prop_glob_RCTs_med[DT$Disease%in%as.character(Mgbd$x[dis]) & DT$Region!="All"] <- 
        as.numeric(as.character(data_f$Prop_all_RCTs_med))
DT$Prop_glob_Patients_med[DT$Disease%in%as.character(Mgbd$x[dis]) & DT$Region!="All"] <- 
        as.numeric(as.character(data_f$Prop_all_Patients_med))
DT$Prop_NHI_RCTs_med[DT$Disease%in%as.character(Mgbd$x[dis]) & DT$Region!="All"] <- 
        as.numeric(as.character(data_f$Prop_NHI_RCTs_med))
DT$Prop_NHI_Patients_med[DT$Disease%in%as.character(Mgbd$x[dis]) & DT$Region!="All"] <- 
        as.numeric(as.character(data_f$Prop_NHI_Patients_med))

In [21]:
head(DT[DT$Disease=="Leprosy",])


RegionDiseaseburden_dalyburden_yllburden_yldburden_deathProp_loc_burden_dalyProp_loc_burden_yllProp_loc_burden_yldProp_loc_burden_deathProp_glob_Patients_upProp_NHI_RCTs_lowProp_NHI_RCTs_medProp_NHI_RCTs_upProp_NHI_Patients_lowProp_NHI_Patients_medProp_NHI_Patients_upDis_labDis_tooltipregs_lab
13All Leprosy 8539.55289646 0 8539.55289646 0 0.0003846535405367680 0.00127215563614428 0 NA NA NA NA NA NA NA Leprosy Leprosy World
41Central Europe, Eastern Europe, and Central AsiaLeprosy 23.8790711 0 23.8790711 0 1.57599038386549e-05 0 4.95251384242701e-05 0 NA NA 20 NA NA 8.83875367881882 NA Leprosy Leprosy Eastern Europe and Central Asia
69High-income Leprosy 23.88100136 0 23.88100136 0 1.03134835933603e-05 0 2.10771246590008e-05 0 NA NA 118 NA NA 173.67164289901 NA Leprosy Leprosy High-income countries
97Latin America and CaribbeanLeprosy 1060.8730239 0 1060.8730239 0 0.000918446042195016 0 0.00214674772386038 0 NA NA 12 NA NA 12.3413448972869 NA Leprosy Leprosy Latin America and Caribbean
125Non-HI Leprosy 8515.6718951 0 8515.6718951 0 0.000428243371288557 0 0.00152620610479439 0 NA NA 100 NA NA 100 NA Leprosy Leprosy Non-high-income countries
153North Africa and Middle EastLeprosy 34.2475894 0 34.2475894 0 3.34863128992032e-05 0 8.2766124077638e-05 0 NA NA 14 NA NA 3.64672822904794 NA Leprosy Leprosy North Africa and Middle East

In [22]:
write.table(DT,"../Interactive_figure/data/data.txt")

In [23]:
ratio_align <- read.table("../Data/Alignment_ratios_within_regions_across_diseases_wt_sims_patients_metrs_burdens.txt")

In [24]:
write.table(ratio_align,"../Interactive_figure/data/data_ratios.txt")

In [ ]: